<template>
  <div>
    <login v-if="show" @hide="shows"></login>
    <user-detail v-if="!show"></user-detail>
  </div>
</template>
<script>
  import Login from '../components/Login'
  import UserDetail from '../components/UserDetail'
  export default {
    data() {
      return {
        uil:"",
        user:{},
        show:true
      }
    },
    components:{
        Login,UserDetail
    },
    methods:{
      shows(val){
        this.show = val
      }
    },
    created(){
      this.user = {}
      this.user = localStorage.getItem('userid')
      if(this.user){
        this.show = false
        this.user = localStorage.getItem('userid')
        // console.log(this.user)
      }else{
        this.show = true
      }
    }
  }

</script>
<style scoped>


</style>
